/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package epaper;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Punit
 */
public class Cities {

    public int AHMEDABAD = 0;
    public int BANGALORE = 1;
    public int CHANDIGARH = 2;
    public int CHENNAI = 3;
    public int DELHI = 4;
    public int HYDERABAD = 5;
    public int JAIPUR = 6;
    public int KOLKATA = 7;
    public int LUCKNOW = 8;
    public int MUMBAI = 9;
    public int PATNA = 10;
    public int PUNE = 11;
    public int RANCHI = 12;
    private static Cities cities;
    private final Map<Integer, String> CONSTANT_MAP =
            Collections.unmodifiableMap(new HashMap<Integer, String>() {
        {
            put(0, "AHMEDABAD");
            put(1, "BANGALORE");
            put(2, "CHANDIGARH");
            put(3, "CHENNAI");
            put(4, "DELHI");
            put(5, "HYDERABAD");
            put(6, "JAIPUR");
            put(7, "KOLKATA");
            put(8, "LUCKNOW");
            put(9, "MUMBAI");
            put(10, "PATNA");
            put(11, "PUNE");
            put(12, "RANCHI");
        }
    });

    private Cities() {
    }

    public static Cities getInstance() {
        if (cities == null) {
            cities = new Cities();
        }
        return cities;
    }

    public String getCity(int i) {
        return CONSTANT_MAP.get(new Integer(i));
    }

    public static boolean isValidCity(int city){
        return (city>0 && city<13);
    }
}
